package UTILES;

public class Cadenas {

    public Cadenas() {
    }

    public boolean validaAlfabetico(String cadena){
    boolean b=true;
    //cadena.toUpperCase();
    String cadenaBase = "ABCDEFGHIJKLMNOPQRSTUWXYZÑ ";
    if(cadena == null){
        b = false;
    }else
    {
     for(int i=0;i<cadena.length();i++)  {
         String caracter = cadena.substring(i, i+1).toUpperCase();
         if(cadenaBase.indexOf(caracter)<0){
             b=false;
         }
     }
    }
    return b;
}
     public boolean validaNumeros(String cadena){
    boolean b=true;
    String cadenaBase = "0123456789";
    if(cadena == null){
        b = false;
    }else
    {
     for(int i=0;i<cadena.length();i++)  {
         String caracter = cadena.substring(i, i+1).toUpperCase();
         if(cadenaBase.indexOf(caracter)<0){
             b=false;
         }
     }
    }
    return b;
}
}
